package com.cawis.controller;

import com.cawis.feign.MyFeignClient;
import com.cawis.util.RedisUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
public class MyController {

    @Resource
    RedisUtils redisUtils;

    @Resource
    MyFeignClient myFeignClient;

    @GetMapping("/flashList")
    public Object flashList(@RequestParam(defaultValue = "2021-07-29 15:00:00") String startTime, @RequestParam(defaultValue = "2021-07-30 15:00:00") String endTime, @RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer pageSize) {
        return myFeignClient.flashList(startTime, endTime, current, pageSize);
    }

    @GetMapping("/dataList")
    public Object dataList(String lineName, Integer lineId) {
        return myFeignClient.dataList(lineName, lineId);
    }

}
